<div id="preview_new"></div>

<% form_remote_for :post, Post.new, 
	{ 
		:loading => "$('new_indicator').show()",
		:complete => "$('new_indicator').hide()",
		:url => { :action => :remote_save_new },
		:html => { :id => "new_post" }
	} do |f| -%>
	
	<h2>New Post</h2>
	
	<label for="post_title">Title:</label><br />
	<%= f.text_field :title, :class => 'fixed' %><br />
	
	<label for="post_raw_text">Raw Text:</label><br />
	<%= f.text_area :raw_text, :cols => '80', :rows => '25', :class => 'fixed' %><br />
	
	<%= submit_tag 'Save', :class => 'submit' %>
	<%= submit_to_remote 'Preview', 'Preview', 
	{
		:loading => "$('new_indicator').show()",
		:complete => "$('new_indicator').hide()",
		:url => { :action => :remote_new_preview } 
	} %>
	or <%= link_to_function 'cancel', "Post.hideNew()" %>
	<%= image_tag 'spinner.gif', :size => '16x16', :alt => "Please wait...", :style => 'display: none', :id => 'new_indicator', :class => 'middle' %>
	
<% end -%>